package com.example.viewpager;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.view.ViewPager;
import android.view.Menu;

public class MainActivity extends Activity {
	ViewPager viewPager;
	List<String> list = new ArrayList<String>();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		initData();
		
		viewPager = (ViewPager) findViewById(R.id.viewpager);
		ViewPagerAdapter adapter =  new ViewPagerAdapter(this, list);
		viewPager.setAdapter(adapter);
	}

	private void initData() {
			list.add("http://h.hiphotos.baidu.com/album/s%3D800%3Bq%3D90/sign=6229f1a8af51f3dec7b2b464a4d58122/3812b31bb051f81979273a28dab44aed2e73e756.jpg");
			list.add("http://g.hiphotos.baidu.com/album/s%3D800%3Bq%3D90/sign=ac5cdadad43f8794d7ff452ee2207fc9/f7246b600c338744d5e1161e510fd9f9d72aa0af.jpg");
			list.add("http://h.hiphotos.baidu.com/album/w%3D2048/sign=b877702e0b55b3199cf9857577918326/4d086e061d950a7b15bc72eb0bd162d9f2d3c917.jpg");
			list.add("http://b.hiphotos.baidu.com/album/w%3D2048/sign=18819ec2a044ad342ebf8087e49a0df4/ae51f3deb48f8c541d4cf9003b292df5e0fe7f05.jpg");
			list.add("http://e.hiphotos.baidu.com/album/w%3D2048/sign=df80a5b02fdda3cc0be4bf2035d13801/5d6034a85edf8db15fa5404b0823dd54564e7411.jpg");
	}

}
